﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FinaceRecordManager.aspx.cs" Inherits="FinaceRecordManager"   Theme="DefaultSkin" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Assembly="ProjectUI" Namespace="ProjectUI" TagPrefix="cc1" %>
<%@ Register src="Navigate.ascx" tagname="Navigate" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>我的生活财务记录</title>
    <script src="JS/jquery.min.js" language="javascript"></script>
    <script src="JS/My97DatePicker/WdatePicker.js"></script>
    <script src="JS/Function.js"></script>
    <script src="FinaceRecordManager.js" language="javascript"  charset="utf-8"></script>
</head>
<body style="text-align:center;">
    <form id="form1" runat="server">
    
     <asp:HiddenField ID="hdnSelectValue" runat="server" /> 
      
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
        
     <uc1:Navigate ID="Navigate1" runat="server" />
     
     
     <table cellpadding="0" cellspacing="0" width="980px">
     <tr>
        <td style="width:150px;margin-left:0px;" valign="top" >
            <iframe src="PayTypeTree.aspx?CallBack=ListRefTreeClick" frameborder="no" width="150px" height="700px" ></iframe>
        </td>
        <td style="padding:0px" valign="top" align="left">
           
             <div style="width:99%;text-align:right;margin-top:5px">
                <span  id="spanDefaultRecord" style="margin-left:25px;font-size:12px"> <b>最近十天的记录</b></span>
                <input id="btnQueryCtrl" type="button" value="显示查询框" class="ButtonBlue7" onclick="ShowQuery();" />
                <input type="button" value="添 加" class="ButtonBlue" onclick="ShowAddFinace();" />
             </div>
                <!--  <input id="btnChooseType" runat="server" type="button" value="↓"   style="width:15px"/> -->
          
              <asp:UpdatePanel ID="UpdatePanel1" runat="server">
              <ContentTemplate>
              
               <table ID="tblQuery" runat="server" class="EditMain" style="margin-top:10px;Width:93%;margin-left:30px;text-align: -moz-center !important;text-align:center"  >
               <tr>
               <td width="100px">
                   <b>收支时间(起):</b>
               </td>
               <td width="200px" align="left">
                    <asp:TextBox ID="txtFinaceTimeStart" runat="server" onfocus="ShowCal();" Width="160px" autocomplete="off"></asp:TextBox>
                    <!--  -->
               </td>
               <td>
                   <b>收支时间(止):</b>
               </td>
               <td align="left">
                     <asp:TextBox ID="txtFinaceTimeEnd" runat="server" onfocus="ShowCal();" Width="160px" autocomplete="off"></asp:TextBox>
               </td>
               </tr>
               <tr style="display:none">
               <td>
                   <b>明细:</b>
               </td>
               <td align="left">>
                   <asp:TextBox ID="txtDetail" runat="server"></asp:TextBox>
              </td>
              <td>
                   <b>收支金额:</b>
              </td>
              <td align="left">>
                   <asp:DropDownList ID="dropAmountOperator" runat="server" Width="50px">
                        <asp:ListItem Text=">=" Value="1"></asp:ListItem>
                        <asp:ListItem Text="<=" Value="-1"></asp:ListItem>
                        <asp:ListItem Text="=" Value="0"></asp:ListItem>
                   </asp:DropDownList>
                   <asp:TextBox ID="txtAmount" runat="server" Width="110px"></asp:TextBox>
               </td>
              </tr>
              <tr>
                <td>
                    <b>收支分类</b>
                </td>
                <td align="left">
                    <asp:TextBox ID="txtFinaceType"  runat="server"  onfocus="ShowDropTreeNode();" ReadOnly="true" autocomplete="off"></asp:TextBox>
                    <div ID="panelTree" runat="server"  style="display:none;z-index:100;position:absolute" >
                        <iframe id="iframeTypeTree" frameborder="no" width="160px" height="300px"></iframe>
                   </div>
                </td>
                <td colspan="2"  class="Center">
                    <a href="#"  onclick="SetQueryTime('lastDay');">昨天</a>
                    <a href="#"  onclick="SetQueryTime('lastWeek');">最近一周</a>
                    <a href="#"   onclick="SetQueryTime('currentMonth');">本月</a>
                    <a href="#"   onclick="SetQueryTime('lastMonth');">最近一月</a>
                    <a href="#"   onclick="SetQueryTime('all');">显示所有记录</a>
                </td>
              </tr>
               <tr>
                <td style="text-align:center;line-height:50px" colspan="4">
                        <asp:Button ID="btnQuery" runat="server" Text="查询" onclick="btnQuery_Click"  />
                        <asp:Button ID="btnRef" runat="server" Text="刷新" onclick="btnRef_Click" style="display:none" />
                </td>
               </tr>
               </table>
    
           <br />
            <asp:GridView ID="gdvShow" runat="server" Width="93%"  style="text-align:left"
                  AutoGenerateColumns="False" align="center" class="Grid" 
                  onrowdeleting="gdvShow_RowDeleting" onrowdatabound="gdvShow_RowDataBound" 
                      AllowPaging="true"   PageSize="20" 
                      onpageindexchanging="gdvShow_PageIndexChanging">
            <HeaderStyle CssClass="GridHead" />
            <RowStyle CssClass="GridItem" />
            <Columns>
                <asp:TemplateField HeaderText="序号">
                <ItemTemplate>
                    <%# Container.DataItemIndex +1 %>
                </ItemTemplate>
                </asp:TemplateField>
               <asp:BoundField DataField="TypeName" HeaderText="收支类型" >
               <ItemStyle Width="100px" />
               </asp:BoundField>
               <asp:TemplateField HeaderText="支出金额">
                <ItemStyle Width="100px" />
               <ItemTemplate>
                    <asp:Label ID="lblPayoutAmount" runat="server"></asp:Label>
               </ItemTemplate>
               </asp:TemplateField>
               <asp:TemplateField HeaderText="收入金额">
               <ItemStyle  Width="100px"/>
               <ItemTemplate>
                    <asp:Label ID="lblIncomeAmount" runat="server"></asp:Label>
               </ItemTemplate>
               </asp:TemplateField>
               <asp:BoundField DataField="Detail" HeaderText="收支明细" />
               <asp:BoundField DataField="PayTime" HeaderText="支付时间" DataFormatString="{0:yyyy-MM-dd}" />
               <asp:BoundField DataField="RecordTime" HeaderText="记录时间" DataFormatString="{0:yyyy-MM-dd}"  />
               <asp:TemplateField  HeaderText="编辑">
               <ItemTemplate >
                    <a href="#" target="_self" onclick="ShowUpdateFinace('<%# Eval("FinaceRecordID") %>');">编辑</a>
               </ItemTemplate>
               </asp:TemplateField>
               <asp:TemplateField HeaderText="删除">
               <ItemTemplate>
                    <asp:LinkButton ID="lnkbtnDel" runat="server" Text="删除" CommandName="Delete" OnClientClick="return confirm('确认删除吗');"></asp:LinkButton>
               </ItemTemplate>
               </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
               <b>没有找到记录</b>
            </EmptyDataTemplate>
            </asp:GridView>
           
             <webdiyer:AspNetPager ID="AspNetPager1" runat="server" style="margin-left:25px;" 
                      onpagechanging="AspNetPager1_PageChanging">
             </webdiyer:AspNetPager>
           
            <ul id="ulAnalyzeFinaceRecord" runat="server"  style="margin-top:15px;margin-left:25px;padding-top:10px;padding-left:10px;width:93%;height:23px;font-size:12px;background:lavender" >
               <li class="li" style="width:150px;">
                  <span  style="font-weight:bold;color:black">查询天数:</span><span style="color:Red"><asp:Label ID="lblDayCount" runat="server">20天</asp:Label></span>
               </li>
               <li   id="liPayOutSum" runat="server" class="li"  style="width:150px;">
                 <span  style="font-weight:bold;color:black">支出合计:</span><span style="color:Red"><asp:Label ID="lblPayOutSum" runat="server">1000.00</asp:Label></span>
               </li>
                <li  id="liDayPayOut" runat="server" class="li"  style="width:150px;">
                 <span  style="font-weight:bold;color:black">日均支出:</span><span style="color:Red"><asp:Label ID="lblDayPayOut" runat="server">1000.00</asp:Label></span>
               </li>
                <li  id="liInComeAmount" runat="server"  class="li"  style="width:150px;">
                  <span  style="font-weight:bold;color:black">收入合计:</span><span style="color:Red"><asp:Label ID="lblInComeAmount" runat="server">1000.00</asp:Label></span>
               </li>
               <li  id="liDayInCome" runat="server" class="li"  style="width:150px;">
                 <span  style="font-weight:bold;color:black">日均收入:</span><span style="color:Red"><asp:Label ID="lblDayInCome" runat="server">1000.00</asp:Label></span>
               </li>
            </ul>

            </ContentTemplate>   
            </asp:UpdatePanel>
            
        </td>
    </tr>
    </table>
    
    <cc1:PopWin ID="PopWinFinaceEdit" runat="server" Width="250px" Height="350px" OffsetTop="-100px" Title="财务记录">
    <ItemTemplate>
       <iframe id="frameEditFinace" src="" frameborder="no" Width="250px" Height="350px"></iframe>
    </ItemTemplate>
    </cc1:PopWin>
    
    </form>
</body>
</html>
